* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #C4B7D7;
}

.tab {
    width: 700px;
    height: 250px;
    color: #705697;
    background-color: #fff;
    overflow: hidden;
}

input {
    display: none;
}

label {
    float: left;
    width: 140px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    font-size: 14px;
    font-weight: 700;
    background-color: #EDEDF5;
    transition: all .3s;
}

label:hover {
    background-color: #fff;
}

label img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-top: -5px;
    margin-right: 5px;
}

ul {
    clear: both;
    width: 3500px;
    height: 210px;
    transition: all .5s;
}

ul li {
    float: left;
    list-style: none;
    width: 700px;
    height: 210px;
    padding: 40px;
}

ul li img {
    float: left;
    width: 130px;
    height: 130px;
    margin-right: 20px;
}

ul li p {
    text-indent: 2em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 20px;
}


#tab1:checked ~ ul {
    margin-left: 0;
}

#tab2:checked ~ ul {
    margin-left: -700px;
}

#tab3:checked ~ ul {
    margin-left: -1400px;
}

#tab4:checked ~ ul {
    margin-left: -2100px;
}

#tab5:checked ~ ul {
    margin-left:-2800px;
}

#tab1:checked ~ label [for="tab1"] {
    background-color: #fff;
}

#tab2:checked ~ label [for="tab1"] {
    background-color: #fff;
}
#tab3:checked ~ label [for="tab1"] {
    background-color: #fff;
}
#tab4:checked ~ label [for="tab1"] {
    background-color: #fff;
}
#tab5:checked ~ label [for="tab1"] {
    background-color: #fff;
}